<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>链接分组设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="admin/template/style.css" />
<script type="text/javascript" src="admin/script/jquery.js"></script>
<script type="text/javascript" src="admin/script/common.js"></script>
</head>
<body>
<div id="wrap">
	<div class="tab">
	<ul>
		<li><a href="admin.php?m=link&f=add">添加链接</a></li>
		<li><a href="admin.php?m=link">所有链接</a></li>
		<li><a href="admin.php?m=linkgroup" class="on">链接分组</a></li>
	</ul>
	</div>
	<div class="main">

		<form name="update" method="post" action="?m=linkgroup&f=update">
			<table class="datalist" cellspacing="0" id="link_list">
				<tr>
					<th width="50" class="firstcol">ID</th>
					<th width="200">组名</th>
					<th width="100">状态</th>
					<th width="100">排序</th>
					<th width="100">链接数量</th>
					<th width="100">操作</th>
					<th>&nbsp;</th>
				</tr>
				<?foreach ($result as $row) {?>
				<tr id="linkgroup_<?=$row['gid']?>">
					<td align="center"><?=$row['gid']?></td>
					<td><input type="text" name="groupname[<?=$row['gid']?>]" value="<?=$row['groupname']?>" /></td>
					<td align="center"><select name="status[<?=$row['gid']?>]"><?=get_status_options($row['status'])?></select></td>
					<td align="center"><input type="text" name="orderid[<?=$row['gid']?>]" value="<?=$row['listorder']?>" size="5" /></td>
					<td align="center"><a href="?m=link&groupid=<?=$row['gid']?>"><b style="color:green"><?=$row['total']?></b></a></td>
					<td align="center"><a href="javascript:;" onclick="delete_linkgroup(<?=$row['gid']?>)" >删除</a></td>
					<td>&nbsp;</td>
				</tr>
				<?}?>
				<tr>
					<td align="center">新增</td>
					<td><input type="text" name="newgroupname" value="" /></td>
					<td align="center"><select name="newstatus"><?=get_status_options($row['status'])?></select></td>
					<td align="center"><input type="text" name="neworderid" value="0" size="5" /></td>
					<td colspan="5">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="10"><input type="submit" class="button" name="s" value="更新设置" /></td>
				</tr>
			</table>
		</form>

	</div>
</div>
<?php include(ADMIN_ROOT.'template/footer.tpl.php');?>